package com.example.huanhang.changzhouapp.util;

import java.util.Random;

public class NumberUtil {

    /**
     * 获取随机字符串 a-z,A-Z,0-9
     *
     * @param length 长度
     * @return
     */
    public static String getRandomString(int length) {
        String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        Random random = new Random();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < length; ++i) {
            sb.append(str.charAt(random.nextInt(62)));
        }
        return sb.toString();
    }
}